package com.Bank;

import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Scanner;

public class GetMonMachine {
    static int num = 0;
    static boolean tag = true;
    static boolean tag_1 = true;
    static Scanner scan = new Scanner(System.in);
    static Method gm = new Method();

    public static void main(String[] args) {
        gm.creatUser();
        while (tag) { // 主菜单
            int num;
            if ((num = gm.dengLu()) != -2) {
                System.out.println("1.存款");
                System.out.println("2.取款");
                System.out.println("3.查询余额");
                System.out.println("4.退出取款机");
                int scan_num = 4;
                try {
                    scan_num = scan.nextInt();
                } catch (InputMismatchException e) {
                    System.out.println("输入非法");
                    e.printStackTrace();
                }
                switch (scan_num) { // 主菜单选择
                    case 1:
                        gm.saveMon(Method.Card, num);
                        break;
                    case 2:
                        gm.getMon(Method.Card, num);
                        break;
                    case 3:
                        gm.cha(Method.Card, num);
                        break;
                    case 4:
                        tag = false;
                        break;
                    default:
                        System.out.println("输入有误，请重新输入");
                        break;
                }
            }
        }
    }
}